package com.gitee.huanminabc.db_freedom;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author miemie
 * @since 2022-11-29
 */
@SpringBootApplication
@EnableTransactionManagement
@EnableAspectJAutoProxy(proxyTargetClass = true)
@MapperScan({"com.gitee.huanminabc.**.mapper"})
@ComponentScan(basePackages = {"com.gitee.huanminabc.**"})
public class ApplicationTestStartSuccess {

    public static void main(String[] args) {
        try {
            //启动springboot,这里只是为了使用springboot的一些工具(容器,注解,AOP啥的)
            SpringApplication springApplication = new SpringApplication(ApplicationTestStartSuccess.class);
            //去掉springboot的banner
            springApplication.setBannerMode((Banner.Mode.OFF));
            //设置为非web项目,不会启动tomcat
            springApplication.setWebApplicationType(WebApplicationType.NONE);
            springApplication.run(args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
